import table from '@/components/dt/table/render.js'
import Opt from '@/components/dt/info/Opt.js'

let _this = null;

class taskColumns extends Opt {
  constructor(vm) {
    super()
    _this = vm
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
    {
      title: '消息日期',
      field: 'createTime',
      minWidth: 120,
      cell: {
        text: {
          type: 'date'
        }
      }
    },
    {
      title: '消息内容 ',
      field: 'tipsCopywriting',
      minWidth: 220,
    },
    {
      title: '操作',
      field: 'operation',
      width: 120,
      align: 'center',
      fixed: 'right',
      slots: {
        default: (params, h) => {
          let btns = []
          btns.push({
            title: _this.unlocking('0102030400') ? '立即处理' : '',
            event: 'handleClick',
            data: params.row
          })
          return table.cell.btns(_this, h, btns)
        }
      }
    }]
  }

}


export default taskColumns